﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace GPToolkit.CSV
{
	public class CSVRow
	{
		/// <summary>
		/// Get values of the row
		/// </summary>
		public ICollection<string> Values { get; internal set; }

		/// <summary>
		/// Initialize a new instance of the CSVRow class
		/// </summary>
		public CSVRow() {
			this.Values = new Collection<string>();
		}

		/// <summary>
		/// Add a value to the row
		/// </summary>
		/// <param name="value">The value to add</param>
		public void AddValue(string value) {
			this.Values.Add(value);
		}

		/// <summary>
		/// Add a collection of values to the row
		/// </summary>
		/// <param name="values">The collection of values to add</param>
		public void AddValues(ICollection<string> values) {
			if (values != null) {
				foreach (string value in values) {
					this.AddValue(value);
				}
			}
		}

		/// <summary>
		/// Clear all the values of the row
		/// </summary>
		public void ClearValues() {
			this.Values.Clear();
		}
	}
}
